package cn.edu.pku.action;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.pku.dao.DepartmentDao;
import cn.edu.pku.dao.HumanDao;
import cn.edu.pku.dao.PositionDao;
import cn.edu.pku.dao.TitleDao;
import cn.edu.pku.model.Department;
import cn.edu.pku.model.Human;
import cn.edu.pku.model.Position;
import cn.edu.pku.model.Title;

import com.opensymphony.xwork2.ActionSupport;

public class UpdateHRRecordAction extends ActionSupport implements BaseAction {
	/**
	 * 
	 */
	private HttpServletRequest request;
	private HttpServletResponse response;
	private Map att;
	
	private HumanDao humanDao;

	private Human human;
	private String humanId;
	

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		System.out.println(humanId);
		Integer id = Integer.parseInt(humanId);
		human.setHumanId(id);
		humanDao.update(human);
		request.setAttribute("humanId", humanId);
		return SUCCESS;
	}

	public HumanDao getHumanDao() {
		return humanDao;
	}

	public void setHumanDao(HumanDao humanDao) {
		this.humanDao = humanDao;
	}

	public Human getHuman() {
		return human;
	}

	public void setHuman(Human human) {
		this.human = human;
	}

	public String getHumanId() {
		return humanId;
	}

	public void setHumanId(String humanId) {
		this.humanId = humanId;
	}

	@Override
	public void setServletRequest(HttpServletRequest request) {
		// TODO Auto-generated method stub
		this.request = request;
	}

	@Override
	public void setServletResponse(HttpServletResponse response) {
		// TODO Auto-generated method stub
		this.response = response;
	}

	@Override
	public void setSession(Map att) {
		// TODO Auto-generated method stub
		this.att = att;
	}
}
